package com.amado.course36ByteStream;

import java.io.File;
import java.io.FileFilter;

public class FileFilterTest {
	public static void main(String[] args) {
		File file = new File("D:\\gitCode\\javase\\src\\main\\java\\com\\amado\\course36ByteStream");
		String fileName = "File";
		for(File tempFile:file.listFiles(new FileFilter() {
			@Override
			public boolean accept(File pathname) {
				if(pathname.getName().contains(fileName)){
					return true;
				}
				return false;
			}
		})){
			System.out.println(tempFile.getName());
		}
	}
}
